#pragma once

typedef int BOOL;
typedef BOOL *LPBOOL;
#define NULL (void*)0
#define TRUE (1)
#define FALSE (0)

#ifndef __cplusplus
typedef BOOL bool;
#define true (1)
#define false (0)
#endif

typedef signed char CHAR;
typedef signed short SHORT;
typedef signed int INT;
typedef signed long LONG;
typedef signed long long LONGLONG;

typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned int UINT;
typedef unsigned long ULONG;
typedef unsigned long long ULONGLONG;

typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned int DWORD;
typedef unsigned long long QWORD;

typedef void *PVOID;
typedef PVOID LPVOID;

typedef LPVOID HANDLE;
typedef HANDLE *LPHANDLE;

typedef char *PSTR;
typedef PSTR LPSTR;

typedef short *PSHORT;
typedef PSHORT LPSHORT;

typedef int *PINT;
typedef PINT LPINT;

typedef long *PLONG;
typedef PLONG LPLONG;

typedef long long *PLONGLONG;
typedef PLONGLONG LPLONGLONG;

typedef const void *PCVOID;
typedef PCVOID LPCVOID;

typedef const char *PCSTR;
typedef PCSTR LPCSTR;

typedef const short *PCSHORT;
typedef PCSHORT LPCSHORT;

typedef const int *PCINT;
typedef PCINT LPCINT;

typedef const long *PCLONG;
typedef PCLONG LPCLONG;

typedef const long long *PCLONGLONG;
typedef PCLONGLONG LPCLONGLONG;

typedef BYTE *PBYTE;
typedef PBYTE LPBYTE;

typedef WORD *PWORD;
typedef PWORD LPWORD;

typedef DWORD *PDWORD;
typedef PDWORD LPDWORD;

typedef QWORD *PQWORD;
typedef PQWORD LPQWORD;

#if defined(__i386)
typedef DWORD SIZE_T;
#else
typedef QWORD SIZE_T
#endif
typedef SIZE_T size_t;

typedef DWORD DWORD_PTR;

typedef LPVOID HANDLE;

#define MAKEWORD(bLow, bHigh) ( ((WORD)bHigh << 8) | (WORD)bLow )
#define MAX(a, b) (a > b ? a : b)
#define MIN(a, b) (a < b ? a : b)